export default {
  //当前时间 时分秒，日期
  getDetailedDate: function () {
    var date = new Date();
    this.year = date.getFullYear();
    this.month = date.getMonth() + 1;
    //this.month = new Array('一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月')[this.month-1];
    this.date = date.getDate();
    this.week = new Array(
      "星期日",
      "星期一",
      "星期二",
      "星期三",
      "星期四",
      "星期五",
      "星期六"
    )[date.getDay()];
    this.hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
    this.minute =
      date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
    this.second =
      date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
    var obj = {
      year: this.year,
      month: this.month,
      date: this.date,
      week: this.week,
      hour: this.hour,
      minute: this.minute,
      second: this.second,
    };

    var time = `${obj.year}-${obj.month}-${obj.date} ${obj.hour}:${obj.minute}:${obj.second} `;
    return time;
  },
};
